package ltd.followkba.comment;

import android.util.Log;

import com.kcbsdk.cjmkcs;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import org.json.JSONTokener;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.Random;

import ltd.advskin.utils.SubUtils;
import ltd.advskin.utils.SysUtils;
import ltd.followkba.R;
import main.MAPI;

public class MUTIL {
    public  final static String Tab_CityLocal[] = {
            "河南 郑州 34.46 113.40","河南 安阳 36.06 114.21","河南 长葛 34.12 113.47","河南 登封 34.27 113.02","河南 邓州 32.42 112.05","河南 巩义 34.46 112.58","河南 鹤壁 35.54 114.11","河南 辉县 35.27 113.47",
            "河南 焦作 35.14 113.12","河南 济源 35.04 112.35","河南 开封 34.47 114.21","河南 灵宝 34.31 110.52","河南 林州 36.03 113.49","河南 漯河 33.33 114.02","河南 洛阳 34.41 112.27","河南 南阳 33.00 112.32",
            "河南 平顶山 33.44 113.17","河南 濮阳 35.44 115.01","河南 沁阳 35.05 112.57","河南 汝州 34.09 112.50","河南 三门峡 34.47 111.12","河南 商丘 34.26 115.38","河南 卫辉 35.24 114.03","河南 舞钢 33.17 113.30",
            "河南 项城 33.26 114.54","河南 荥阳 34.46 113.21","河南 新密 34.31 113.22","河南 新乡 35.18 113.52","河南 信阳 32.07 114.04","河南 新郑 34.24 113.43","河南 许昌 34.01 113.49","河南 偃师 34.43 112.47",
            "河南 义马 34.43 111.55","河南 禹州 34.09 113.28","河南 周口 33.37 114.38","河南 驻马店 32.58 114.01","安徽 合肥 31.52 117.17","安徽 安庆 30.31 117.02","安徽 蚌埠 32.56 117.21","安徽 亳州 33.52 115.47",
            "安徽 巢湖 31.36 117.52","安徽 滁州 32.18 118.18","安徽 阜阳 32.54 115.48","安徽 贵池 30.39 117.28","安徽 淮北 33.57 116.47","安徽 淮南 32.37 116.58","安徽 黄山 29.43 118.18","安徽 界首 33.15 115.21",
            "安徽 六安 31.44 116.28","安徽 马鞍山 31.43 118.28","安徽 明光 32.47 117.58","安徽 宿州 33.38 116.58","安徽 天长 32.41 118.59","安徽 铜陵 30.56 117.48","安徽 芜湖 31.19 118.22","安徽 宣州 30.57 118.44",
            "澳门   澳门 21.33 115.07","北京 北京 39.55 116.24","福建 福州 26.05 119.18","福建 长乐 25.58 119.31","福建 福安 27.06 119.39","福建 福清 25.42 119.23","福建 建瓯 27.03 118.20","福建 建阳 27.21 118.07",
            "福建 晋江 24.49 118.35","福建 龙海 24.26 117.48","福建 龙岩 25.06 117.01","福建 南安 24.57 118.23","福建 南平 26.38 118.10","福建 宁德 26.39 119.31","福建 莆田 24.26 119.01","福建 泉州 24.56 118.36",
            "福建 三明 26.13 117.36","福建 邵武 27.20 117.29","福建 石狮 24.44 118.38","福建 武夷山 27.46 118.02","福建 厦门 24.27 118.06","福建 永安 25.58 117.23","福建 漳平 25.17 117.24","福建 漳州 24.31 117.39",
            "甘肃 兰州 36.04 103.51","甘肃 白银 36.33 104.12","甘肃 敦煌 40.08 94.41","甘肃 嘉峪关 39.48 98.14","甘肃 金昌 38.28 102.10","甘肃 酒泉 39.44 98.31","甘肃 临夏 35.37 103.12","甘肃 平凉 35.32 106.40",
            "甘肃 天水 34.37 105.42","甘肃 武威 37.56 102.39","甘肃 西峰 35.45 107.40","甘肃 玉门 39.49 97.35","甘肃 张掖 38.56 100.26","广东 广州 23.08 113.14","广东 潮阳 23.16 116.36","广东 潮州 23.40 116.38",
            "广东 澄海 23.28 116.46","广东 从化 23.33 113.33","广东 东莞 23.02 113.45","广东 恩平 22.12 112.19","广东 佛山 23.02 113.06","广东 高明 22.53 112.50","广东 高要 23.02 112.26","广东 高州 21.54 110.50",
            "广东 鹤山 22.46 112.57","广东 河源 23.43 114.41","广东 花都 23.23 113.12","广东 化州 21.39 110.37","广东 惠阳 22.48 114.28","广东 惠州 23.05 114.22","广东 江门 22.35 113.04","广东 揭阳 22.32 116.21",
            "广东 开平 22.22 112.40","广东 乐昌 25.09 113.21","广东 雷州 20.54 110.04","广东 廉江 21.37 110.17","广东 连州 24.48 112.23","广东 罗定 22.46 111.33","广东 茂名 21.40 110.53","广东 梅州 24.19 116.07",
            "广东 南海 23.01 113.09","广东 番禺 22.57 113.22","广东 普宁 23.18 116.10","广东 清远 23.42 113.01","广东 三水 23.10 112.52","广东 汕头 23.22 116.41","广东 汕尾 22.47 115.21","广东 韶关 24.48 113.37",
            "广东 深圳 22.33 114.07","广东 顺德 22.50 113.15","广东 四会 23.21 112.41","广东 台山 22.15 112.48","广东 吴川 21.26 110.47","广东 新会 22.32 113.01","广东 兴宁 24.09 115.43","广东 阳春 22.10 111.48",
            "广东 阳江 21.50 111.58","广东 英德 24.10 113.22","广东 云浮 22.57 112.02","广东 增城 23.18 113.49","广东 湛江 21.11 110.24","广东 肇庆 23.03 112.27","广东 中山 22.31 113.22","广东 珠海 22.17 113.34",
            "广西 南宁 22.48 108.19","广西 北海 21.28 109.07","广西 北流 22.42 110.21","广西 百色 23.54 106.36","广西 防城港 21.37 108.20","广西 贵港 23.06 109.36","广西 桂林 25.17 110.17","广西 桂平 23.22 110.04",
            "广西 河池 24.42 108.03","广西 合山 23.47 108.52","广西 柳州 23.19 109.24","广西 赁祥 22.07 106.44","广西 钦州 21.57 108.37","广西 梧州 23.29 111.20","广西 玉林 22.38 110.09","广西 宜州 24.28 108.40",
            "贵州 贵阳 26.35 106.42","贵州 安顺 26.14 105.55","贵州 毕节 27.18 105.18","贵州 赤水 28.34 105.42","贵州 都匀 26.15 107.31","贵州 凯里 26.35 107.58","贵州 六盘水 26.35 104.50","贵州 清镇 26.33 106.27",
            "贵州 铜仁 27.43 109.12","贵州 兴义 25.05 104.53","贵州 遵义 27.42 106.55","海南 海口 20.02 110.20","海南 儋州 19.31 109.34","海南 琼海 19.14 110.28","海南 琼山 19.59 110.21","海南 三亚 18.14 109.31",
            "海南 通什 18.46 109.31","河北 石家庄 38.02 114.30","河北 安国 38.24 115.20","河北 保定 38.51 115.30","河北 霸州 39.06 116.24","河北 泊头 38.04 116.34","河北 沧州 38.18 116.52","河北 承德 40.59 117.57",
            "河北 定州 38.30 115.00","河北 丰南 39.34 118.06","河北 高碑店 39.20 115.51","河北 蒿城 38.02 114.50","河北 邯郸 36.36 114.28","河北 河间 38.26 116.05","河北 衡水 37.44 115.42","河北 黄骅 38.21 117.21",
            "河北 晋州 38.02 115.02","河北 冀州 37.34 115.33","河北 廓坊 39.31 116.42","河北 鹿泉 38.04 114.19","河北 南宫 37.22 115.23","河北 秦皇岛 39.55 119.35","河北 任丘 38.42 116.07","河北 三河 39.58 117.04",
            "河北 沙河 36.51 114.30","河北 深州 38.01 115.32","河北 唐山 39.36 118.11","河北 武安 36.42 114.11","河北 邢台 37.04 114.30","河北 辛集 37.54 115.12","河北 新乐 38.20 114.41","河北 张家口 40.48 114.53",
            "河北 涿州 39.29 115.59","河北 遵化 40.11 117.58","黑龙江 哈尔滨 45.44 126.36","黑龙江 阿城 45.32 126.58","黑龙江 安达 46.24 125.18","黑龙江 北安 48.15 126.31","黑龙江 大庆 46.36 125.01","黑龙江 富锦 47.15 132.02",
            "黑龙江 海林 44.35 129.21","黑龙江 海伦 47.28 126.57","黑龙江 鹤岗 47.20 130.16","黑龙江 黑河 50.14 127.29","黑龙江 佳木斯 46.47 130.22","黑龙江 鸡西 45.17 130.57","黑龙江 密山 45.32 131.50","黑龙江 牡丹江 44.35 129.36",
            "黑龙江 讷河 48.29 124.51","黑龙江 宁安 44.21 129.28","黑龙江 齐齐哈尔 47.20 123.57","黑龙江 七台河 45.48 130.49","黑龙江 双城 45.22 126.15","黑龙江 尚志 45.14 127.55","黑龙江 双鸭山 46.38 131.11","黑龙江 绥芬河 44.25 131.11",
            "黑龙江 绥化 46.38 126.59","黑龙江 铁力 46.59 128.01","黑龙江 同江 47.39 132.30","黑龙江 五常 44.55 127.11","黑龙江 五大连池 48.38 126.07","黑龙江 伊春 47.42 128.56","黑龙江 肇东 46.04 125.58","湖北 武汉 30.35 114.17",
            "湖北 安陆 31.15 113.41","湖北 当阳 30.50 111.47","湖北 丹江口 32.33 108.30","湖北 大冶 30.06 114.58","湖北 恩施 30.16 109.29","湖北 鄂州 30.23 114.52","湖北 广水 31.37 113.48","湖北 洪湖 29.48 113.27",
            "湖北 黄石 30.12 115.06","湖北 黄州 30.27 114.52","湖北 荆门 31.02 112.12","湖北 荆沙 30.18 112.16","湖北 老河口 32.23 111.40","湖北 利川 30.18 108.56","湖北 麻城 31.10 115.01","湖北 浦圻 29.42 113.51",
            "湖北 潜江 30.26 112.53","湖北 石首 29.43 112.24","湖北 十堰 32.40 110.47","湖北 随州 31.42 113.22","湖北 天门 60.39 113.10","湖北 武穴 29.51 115.33","湖北 襄樊 32.02 112.08","湖北 咸宁 29.53 114.17",
            "湖北 仙桃 30.22 113.27","湖北 孝感 30.56 113.54","湖北 宜昌 30.42 111.17","湖北 宜城 31.42 112.15","湖北 应城 30.57 113.33","湖北 枣阳 32.07 112.44","湖北 枝城 30.23 111.27","湖北 钟祥 31.10 112.34",
            "湖南 长沙 28.12 112.59","湖南 常德 29.02 111.51","湖南 郴州 25.46 113.02","湖南 衡阳 26.53 112.37","湖南 洪江 27.07 109.59","湖南 怀化 27.33 109.58","湖南 津 29.38 111.52","湖南 吉首 28.18 109.43",
            "湖南 耒阳 26.24 112.51","湖南 冷水江 27.42 111.26","湖南 冷水滩 26.26 111.35","湖南 涟源 27.41 111.41","湖南 醴陵 27.40 113.30","湖南 临湘 29.29 113.27","湖南 浏阳 28.09 113.37","湖南 娄底 27.44 111.59",
            "湖南 汨罗 28.49 113.03","湖南 韶山 27.54 112.29","湖南 邵阳 27.14 111.28","湖南 武冈 26.43 110.37","湖南 湘潭 27.52 112.53","湖南 湘乡 27.44 112.31","湖南 益阳 28.36 112.20","湖南 永州 26.13 111.37",
            "湖南 沅江 28.50 112.22","湖南 岳阳 29.22 113.06","湖南 张家界 29.08 110.29","湖南 株洲 27.51 113.09","湖南 资兴 25.58 113.13","吉林 长春 43.54 125.19","吉林 白城 45.38 122.50","吉林 白山 41.56 126.26",
            "吉林 大安 45.30 124.18","吉林 德惠 44.32 125.42","吉林 敦化 43.22 128.13","吉林 公主岭 43.31 124.49","吉林 和龙 42.32 129.00","吉林 桦甸 42.58 126.44","吉林 珲春 42.52 130.22","吉林 集安 41.08 126.11",
            "吉林 蛟河 43.42 127.21","吉林 吉林 43.52 126.33","吉林 九台 44.09 125.51","吉林 辽源 42.54 125.09","吉林 临江 41.49 126.53","吉林 龙井 42.46 129.26","吉林 梅河口 42.32 125.40","吉林 舒兰 44.24 126.57",
            "吉林 四平 43.10 124.22","吉林 松原 45.11 124.49","吉林 洮南 45.20 122.47","吉林 通化 41.43 125.56","吉林 图们 42.57 129.51","吉林 延吉 42.54 129.30","吉林 愉树 44.49 126.32","江苏 南京 32.03 118.46",
            "江苏 常熟 31.39 120.43","江苏 常州 31.47 119.58","江苏 丹阳 32.00 119.32","江苏 东台 32.51 120.19","江苏 高邮 32.47 119.27","江苏 海门 31.53 121.09","江苏 淮安 33.30 119.09","江苏 淮阴 33.36 119.02",
            "江苏 江都 32.26 119.32","江苏 姜堰 32.34 120.08","江苏 江阴 31.54 120.17","江苏 靖江 32.02 120.17","江苏 金坛 31.46 119.33","江苏 昆山 31.23 120.57","江苏 连去港 34.36 119.10","江苏 溧阳 31.26 119.29",
            "江苏 南通 32.01 120.51","江苏 邳州 34.19 117.59","江苏 启乐 31.48 121.39","江苏 如皋 32.23 120.33","江苏 宿迁 33.58 118.18","江苏 苏州 31.19 120.37","江苏 太仓 31.27 121.06","江苏 泰兴 32.10 120.01",
            "江苏 泰州 32.30 119.54","江苏 通州 32.05 121.03","江苏 吴江 31.10 120.39","江苏 无锡 31.34 120.18","江苏 兴化 32.56 119.50","江苏 新沂 34.22 118.20","江苏 徐州 34.15 117.11","江苏 盐在 33.22 120.08",
            "江苏 扬中 32.14 119.49","江苏 扬州 32.23 119.26","江苏 宜兴 31.21 119.49","江苏 仪征 32.16 119.10","江苏 张家港 31.52 120.32","江苏 镇江 32.11 119.27","江西 南昌 28.40 115.55","江西 德兴 28.57 117.35",
            "江西 丰城 28.12 115.48","江西 赣州 28.52 114.56","江西 高安 28.25 115.22","江西 吉安 27.07 114.58","江西 景德镇 29.17 117.13","江西 井冈山 26.34 114.10","江西 九江 29.43 115.58","江西 乐平 28.58 117.08",
            "江西 临川 27.59 116.21","江西 萍乡 27.37 113.50","江西 瑞昌 29.40 115.38","江西 瑞金 25.53 116.01","江西 上饶 25.27 117.58","江西 新余 27.48 114.56","江西 宜春 27.47 114.23","江西 鹰潭 28.14 117.03",
            "江西 樟树 28.03 115.32","辽宁 沈阳 41.48 123.25","辽宁 鞍山 41.07 123.00","辽宁 北票 41.48 120.47","辽宁 本溪 41.18 123.46","辽宁 朝阳 41.34 120.27","辽宁 大连 38.55 121.36","辽宁 丹东 40.08 124.22",
            "辽宁 大石桥 40.37 122.31","辽宁 东港 39.53 124.08","辽宁 凤城 40.28 124.02","辽宁 抚顺 41.51 123.54","辽宁 阜新 42.01 121.39","辽宁 盖州 40.24 122.21","辽宁 海城 40.51 122.43","辽宁 葫芦岛 40.45 120.51",
            "辽宁 锦州 41.07 121.09","辽宁 开原 42.32 124.02","辽宁 辽阳 41.16 123.12","辽宁 凌海 41.10 121.21","辽宁 凌源 41.14 119.22","辽宁 盘锦 41.07 122.03","辽宁 普兰店 39.23 121.58","辽宁 铁法 42.28 123.32",
            "辽宁 铁岭 42.18 123.51","辽宁 瓦房店 39.37 122.00","辽宁 兴城 40.37 120.41","辽宁 新民 41.59 122.49","辽宁 营口 40.39 122.13","辽宁 庄河 39.41 122.58","内蒙 呼和浩特 40.48 111.41","内蒙 包头 40.39 109.49",
            "内蒙 赤峰 42.17 118.58","内蒙 东胜 39.48 109.59","内蒙 二连浩特 43.38 111.58","内蒙 额尔古纳 50.13 120.11","内蒙 丰镇 40.27 113.09","内蒙 根河 50.48 121.29","内蒙 海拉尔 49.12 119.39","内蒙 霍林郭勒 45.32 119.38",
            "内蒙 集宁 41.02 113.06","内蒙 临河 40.46 107.22","内蒙 满洲里 49.35 117.23","内蒙 通辽 43.37 122.16","内蒙 乌兰浩特 46.03 122.03","内蒙 乌海 39.40 106.48","内蒙 锡林浩特 43.57 116.03","内蒙 牙克石 49.17 120.40",
            "内蒙 扎兰屯 48.00 122.47","宁夏 银川 38.27 106.16","宁夏 青铜峡 37.56 105.59","宁夏 石嘴山 39.02 106.22","宁夏 吴忠 37.59 106.11","青海 西宁 36.38 101.48","青海 德令哈 37.22 97.23","青海 格尔木 36.26 94.55",
            "山东 济南 36.40 117.00","山东 安丘 36.25 119.12","山东 滨州 37.22 118.02","山东 昌邑 39.52 119.24","山东 德州 37.26 116.17","山东 东营 37.27 118.30","山东 肥城 36.14 116.46","山东 高密 36.22 119.44",
            "山东 菏泽 35.14 115.26","山东 胶南 35.53 119.58","山东 胶州 36.17 120.00","山东 即墨 36.22 120.28","山东 济宁 35.23 116.33","山东 莱芜 36.12 117.40","山东 莱西 36.52 120.31","山东 莱阳 36.58 120.42",
            "山东 莱州 37.10 119.57","山东 乐陵 37.44 117.12","山东 聊城 36.26 115.57","山东 临清 36.51 115.42","山东 临沂 35.03 118.20","山东 龙口 37.39 120.21","山东 蓬莱 37.48 120.45","山东 平度 36.47 119.58",
            "山东 青岛 36.03 120.18","山东 青州 36.42 118.28","山东 曲阜 35.36 116.58","山东 日照 35.23 119.32","山东 荣成 37.10 122.25","山东 乳山 36.54 121.31","山东 寿光 36.53 118.44","山东 泰安 36.11 117.08",
            "山东 滕州 35.06 117.09","山东 潍坊 36.43 119.06","山东 威海 37.31 122.07","山东 文登 37.12 122.03","山东 新泰 35.54 117.45","山东 烟台 37.32 121.24","山东 兖州 35.32 116.49","山东 禹城 36.56 116.39",
            "山东 枣庄 34.52 117.33","山东 章丘 36.43 117.32","山东 招远 37.21 120.23","山东 诸城 35.59 119.24","山东 淄博 36.48 118.03","山东 邹城 35.24 116.58","山西 太原 37.54 112.33","山西 长治 36.11 113.06",
            "山西 大同 40.06 113.17","山西 高平 35.48 112.55","山西 古交 37.54 112.09","山西 河津 35.35 110.41","山西 侯马 35.37 111.21","山西 霍州 36.34 111.42","山西 介休 37.02 111.55","山西 晋城 35.30 112.51",
            "山西 临汾 36.05 111.31","山西 潞城 36.21 113.14","山西 朔州 39.19 112.26","山西 孝义 37.08 111.48","山西 忻州 38.24 112.43","山西 阳泉 37.51 113.34","山西 永济 34.52 110.27","山西 原平 38.43 112.42",
            "山西 榆次 37.41 112.43","山西 运城 35.02 110.59","陕西 西安 34.17 108.57","陕西 安康 32.41 109.01","陕西 宝鸡 34.22 107.09","陕西 韩城 35.28 110.27","陕西 汉中 33.04 107.01","陕西 华阴 34.34 110.05",
            "陕西 商州 33.52 109.57","陕西 铜川 35.06 109.07","陕西 渭南 34.30 109.30","陕西 咸阳 34.20 108.43","陕西 兴平 34.18 108.29","陕西 延安 36.35 109.28","陕西 榆林 38.18 109.47","上海 上海 31.14 121.29",
            "四川 成都 30.40 104.04","四川 巴中 31.51 106.43","四川 崇州 30.39 103.40","四川 达川 31.14 107.29","四川 德阳 31.09 104.22","四川 都江堰 31.01 103.37","四川 峨眉山 29.36 103.29","四川 涪陵 29.42 107.22",
            "四川 广汉 30.58 104.15","四川 广元 32.28 105.51","四川 华蓥 30.26 106.44","四川 简阳 30.24 104.32","四川 江油 31.48 104.42","四川 阆中 31.36 105.58","四川 乐山 29.36 103.44","四川 泸州 28.54 105.24",
            "四川 绵阳 31.30 104.42","四川 南充 30.49 106.04","四川 内江 29.36 105.02","四川 攀枝花 26.34 101.43","四川 彭州 30.59 103.57","四川 邛崃 30.26 103.28","四川 遂宁 30.31 105.33","四川 万县 30.50 108.21",
            "四川 万源 32.03 108.03","四川 西昌 27.54 102.16","四川 雅安 29.59 102.59","四川 宜宾 28.47 104.34","四川 自贡 29.23 104.46","四川 资阳 30.09 104.38","台湾 台北 25.03 121.30","天津 天津 39.02 117.12",
            "西藏 拉萨 29.39 91.08","西藏 日喀则 29.16 88.51","香港 香港 21.23 115.12","新疆 乌鲁木齐 43.45 87.36","新疆 阿克苏 41.09 80.19","新疆 阿勒泰 47.50 88.12","新疆 阿图什 39.42 76.08","新疆 博乐 44.57 82.08",
            "新疆 昌吉 44.02 87.18","新疆 阜康 44.09 87.58","新疆 哈密 42.50 93.28","新疆 和田 37.09 79.55","新疆 克拉玛依 45.36 84.51","新疆 喀什 39.30 75.59","新疆 库尔勒 41.46 86.07","新疆 奎屯 44.27 84.56",
            "新疆 石河子 44.18 86.00","新疆 塔城 46.46 82.59","新疆 吐鲁番 42.54 89.11","新疆 伊宁 43.55 81.20","云南 昆明 25.04 102.42","云南 保山 25.08 99.10","云南 楚雄 25.01 101.32","云南 大理 25.34 100.13",
            "云南 东川 26.06 103.12","云南 个旧 23.21 103.09","云南 景洪 22.01 100.48","云南 开远 23.43 103.13","云南 曲靖 25.30 103.48","云南 瑞丽 24.00 97.50","云南 思茅 22.48 100.58","云南 畹町 24.06 98.04",
            "云南 宣威 26.13 104.06","云南 玉溪 24.22 102.32","云南 昭通 27.20 103.42","浙江 杭州 30.16 120.10","浙江 慈溪 30.11 121.15","浙江 东阳 29.16 120.14","浙江 奉化 29.39 121.24","浙江 富阳 30.03 119.57",
            "浙江 海宁 30.32 120.42","浙江 湖州 30.52 120.06","浙江 建德 29.29 119.16","浙江 江山 28.45 118.37","浙江 嘉兴 30.46 120.45","浙江 金华 29.07 119.39","浙江 兰溪 29.12 119.28","浙江 临海 28.51 121.08",
            "浙江 丽水 28.27 119.54","浙江 龙泉 28.04 119.08","浙江 宁波 29.52 121.33","浙江 平湖 30.42 121.01","浙江 衢州 28.58 118.52","浙江 瑞安 27.48 120.38","浙江 上虞 30.01 120.52","浙江 绍兴 30.00 120.34",
            "浙江 台州 28.41 121.27","浙江 桐乡 30.38 120.32","浙江 温岭 28.22 121.21","浙江 温州 28.01 120.39","浙江 萧山 30.09 120.16","浙江 义乌 29.18 120.04","浙江 乐清 28.08 120.58","浙江 余杭 30.26 120.18",
            "浙江 余姚 30.02 121.10","浙江 永康 29.54 120.01","浙江 舟山 30.01 122.06","浙江 诸暨 29.43 120.14","重庆 重庆 29.35 106.33","重庆 合川 30.02 106.15","重庆 江津 29.18 106.16","重庆 南川 29.10 107.05",
            "重庆 永川 29.23 105.53 ",
    };

    public final static String Tab_APP_MOBIL_BRAND[] = {
            "Puyan",	"Tinme",	"Alcate",	"Sobao",	"Arcoa",	"Sanyo",	"Benten",	"LuckyStar",
            "Xoceco",	"Sagem",	"Capite",	"Casio",	"Sharp",	"Sewon",	"Chase",	"Innostream",
            "Sendo",	"Cosun",	"Daewoo",	"Datang",	"Daxian",	"Dbte",	"Denso",	"SonyERSSION",
            "Doeasy",	"Docomo",	"Dopod",	"Dragon",	"Eastcom",	"SkyNet",	"Suohong",	"Siemens",

            "Gplus",	"Great",	"Toshiba",	"Gstar",	"Hagenuk",	"Hisense",	"Haier",	"Mitsubishi",
            "Hitachi",	"Hute",	"Hyundai",	"Telsda",	"Victor",	"Kejian",	"Kenwood",	"Transasia",
            "Vtech",	"Konka",	"Vodafone","Kyocera",	"Lenovo",	"Lucent",	"Teltron",	"Qualcomm",
            "Maxon",	"Mitac",	"Trium",	"Ulycom",	"Telson",	"Soutec",	"Bosch",	"Motorola",

            "Nintaus",	"Nixxo",	"Nokia",	"Malata",	"OKWAP",	"OMRON",	"PALMAX",	"Panasonnic",
            "PENESAS",	"Panda",	"Philips",	"Phota",	"GALAXY",	"Gionee",	"Toplux",	"Ericsson",
     };
    public final static String Tab_MailSvr[] = {
            "163.com","qq.com","gmail.com","sina.com","hotmail.com","189.com","tom.com","21cn.com",
            "139.com","126.com","263.com","yeah.net","outlook.com","sina.cn","syvip.com","eyou.com",
            "aliyun.com",
    };
    public  final static String Tab_YanChang[] = {
            "全国",	"北京",	"上海",	"天津",	"重庆",	"浙江",	"广东",	"江苏",	"山东",	"福建",	"安徽",	"四川",
            "湖北",	"河北",	"云南",	"黑龙江",	"吉林",	"辽宁",	"海南",	"湖南",	"河南",	"贵州",	"江西",	"广西",
            "陕西",	"山西",	"青海",	"宁夏",	"甘肃",	"西藏",	"内蒙古",	"新疆",	"台湾",	"香港",	"澳门",
    };
    public final static String Tab_ChangBaTop[] = {
            "全国",
            // 华南地区 广东、广西、海南、香港、澳门
            "广东",	"广州",	"深圳",	"珠海",	"汕头",	"韶关",	"佛山",	"江门",	"湛江",	"茂名",
            "肇庆",	"惠州",	"梅州",	"汕尾",	"河源",	"阳江",	"清远",	"东莞",	"中山",	"潮州",
            "揭阳",	"云浮",
            "广西",	"南宁",	"柳州",	"桂林",	"梧州",	"北海",	"防城港",	"钦州",	"贵港",	"玉林",
            "百色",	"贺州",	"河池",	"来宾",	"崇左",
            "海南",	"海口",	"文昌",	"三亚",	"五指山",	"琼海",	"儋州",	"万宁",
            "香港",	"澳门",
            // 华东地区	上海、江苏、浙江、安徽、福建、江西、山东、台湾
            "上海",
            "江苏",	"南京",	"苏州",	"无锡",	"常州",	"扬州",	"泰州",	"连云港",	"徐州",	"淮安",
            "宿迁",	"盐城",	"南通",	"镇江",
            "浙江",	"嘉兴",	"温州",	"金华",	"绍兴",	"湖州",	"宁波",	"杭州",	"舟山",	"台州",
            "衢州",	"丽水",
            "福建",	"厦门",	"泉州",	"三明",	"南平",	"龙岩",	"漳州",	"宁德",	"莆田",	"福州",
            "江西",	"南昌",	"景德镇",	"九江",	"萍乡",	"新余",	"鹰潭",	"赣州",	"宜春",	"上饶",
            "吉安",	"抚州",
            "山东",	"济南",	"青岛",	"淄博",	"枣庄",	"东营",	"烟台",	"潍坊",	"济宁",	"泰安",
            "威海",	"日照",	"滨州",	"德州",	"聊城",	"临沂",	"菏泽",	"莱芜",
            "台湾",
            // 华中地区	河南，湖北，湖南
            "湖北",	"武汉",	"黄石",	"十堰",	"荆州",	"宜昌",	"襄阳",	"鄂州",	"荆门",	"孝感",
            "黄冈",	"咸宁",	"随州",	"恩施",	"仙桃",	"天门",	"潜江",	"神农架",
            "湖南",	"长沙",	"株洲",	"湘潭",	"衡阳",	"邵阳",	"岳阳",	"常德",	"张家界",	"益阳",
            "郴州",	"永州",	"怀化",	"娄底",	"湘西",
            "河南",	"郑州",	"洛阳",	"焦作",	"安阳",	"平顶山",	"漯河",	"鹤壁",	"新乡",	"南阳",
            "济源",	"商丘",	"濮阳",	"许昌",	"开封",	"三门峡",	"信阳",	"驻马店",	"周口",
            // 华北地区	京、津、河、山西、内蒙古
            "北京",	"天津",
            "河北",	"石家庄",	"邯郸",	"保定",	"承德",	"唐山",	"廊坊",	"沧州",	"衡水",	"邢台",
            "秦皇岛",
            "山西",	"太原",	"大同",	"阳泉",	"长治",	"晋城",	"朔州",	"晋中",	"运城",	"忻州",
            "临汾",	"吕梁",
            "内蒙古",	"呼和浩特","呼伦贝尔","兴安",	"通辽",	"赤峰",	"锡林郭勒","乌兰察布","包头",	"鄂尔多斯",
            "巴彦淖尔","乌海",	"阿拉善",
            // 西北地区	宁夏、新疆，青海 、陕西 、甘肃
            "宁夏",	"吴忠",	"中卫",	"固原",	"银川",	"石嘴山",
            "青海",	"西宁",	"黄南",	"果洛",	"玉树",
            "陕西",	"西安",	"咸阳",	"商洛",	"安康",	"汉中",	"延安",	"渭南",	"铜川",	"榆林",
            "甘肃",	"兰州",	"天水",	"白银",	"平凉",	"庆阳",	"陇南",	"定西",	"金昌",	"武威",
            "张掖",	"酒泉",	"嘉峪关",	"临夏",	"甘南",
            // 西南地区	四川、重庆，贵州 、云南 、西藏
            "四川",	"成都",	"自贡",	"攀枝花",	"泸州",	"德阳",	"绵阳",	"广元",	"遂宁",	"内江",
            "乐山",	"南充",	"宜宾",	"广安",	"达州",	"眉山",	"雅安",	"巴中",	"资阳",	"阿坝",
            "甘孜",	"凉山",
            "重庆",
            "贵州",	"六盘水",	"遵义",	"铜仁",	"毕节",	"贵阳",
            "云南",	"昆明",	"曲靖",	"玉溪",	"保山",	"昭通",	"丽江",	"临沧",	"文山",	"红河",
            "西双版纳","楚雄",	"大理",	"德宏",	"怒江",	"迪庆",
            // 东北地区	辽宁、吉林、黑龙江、蒙东
            "辽宁",	"沈阳",	"大连",	"鞍山",	"抚顺",	"本溪",	"丹东",	"锦州",	"营口",	"阜新",
            "辽阳",	"盘锦",	"铁岭",	"葫芦岛",
            "吉林",	"延边",	"长春",	"松原",	"白城",	"通化",	"长白山",	"吉林",	"辽源",	"四平",
            "安徽",	"合肥",	"芜湖",	"蚌埠",	"马鞍山",	"淮北",	"铜陵",	"安庆",	"黄山",	"滁州",
            "阜阳",	"宿州",	"巢湖",	"六安",	"池州",	"宣城",
            "黑龙江",	"哈尔滨",	"齐齐哈尔","牡丹江",	"佳木斯",	"大庆",	"鸡西",	"伊春",	"双鸭山",	"七台河",
            "鹤岗",	"黑河",	"绥化",	"大兴安岭",
     };
    public final static String Tab_AutoComment[] = {
            "你歌好听，交个朋友吧。", "唱歌好听的都去听我歌了", "来了，就先听歌", "不错，交个朋友吧","很棒，很棒，",   "加油，加 油，支持你", "喜欢你的歌，更喜欢你的声音", "有空记得去看看我",
            "长得好看的都去我主页听歌了。", "完美挖，给力", "唱得真好~", "真给力，唱的不错。","从你的歌声里面听到了故 事", "好听~有空也来看看我哦", "真棒，交个朋友！", "加油，求回访希望可以一起进步~",
            "很好听~", "赞一个，唱的真好", "走心了，好听", "来了就先听歌.","我过来听歌咯", "过来留个小脚印", "朋友唱 功了得", "让我静静地把它听完",
            "没有花花了，花花送完了", "要的就是这种感觉", "期待你以后的作品",
            "我要做你的铁粉", "我听到了一幅美丽的画面","要的就是这种感觉","好棒，你怎么做到的", "又一个明日之星", "遇 见最美好声音", "听了十遍，还在听",
            "赞,好赞,太赞,超级赞!!!", "哈哈,你是原唱吧","怎么能唱得酱紫好听", "好歌好嗓子好有质感", "听得我飘起来啦",  "爱死你的声音了", "不经意间听到，却一下就刻入了脑海","空灵的声音，让人难忘",
            "支持性格，好棒，好棒。", "来的及时，歌还没凉/哈哈", "发歌了怎么不告诉我，还让我自己来", "这首很不错，很 喜欢。", "很给力，赞赞赞赞。", "转发歌曲：支持朋友，支持永远",
            "我来了，支持。嘎嘎", "没花了，虽然是，但是只能评论一下了", "不带花，来听歌。不要 介意", "不错，很喜欢这首，期待再出新作",
            "无限好，听到不想走", "支持，必须循环播放/哈哈", "棒棒哒。好听", "独特风格 ，支持", "出炉，必须支持，赞赞赞",
            "来听歌，比原唱还好听，支持", "挺你，望能来指点一下", "不愧是好声音，加油", "支持你来啦", "唱的真好，支持 你，朋友", "好听，给你一万个赞", "我过来听歌咯", "过来留个小脚印",
            "朋友唱功了得", "让我静静地把它听完", "没有花花了，花花送完了", "要的就是这种感觉", "期待你以后的作品", " 好棒，你怎么做到的", "又一个明日之星", "遇见最美好声音", "听了十遍，还在听",
            "我要做你的铁粉", "怎么能唱得酱紫 好听", "好歌好嗓子好有质感", "听得我飘起来啦", "爱死你 的声音了", "不经 意间听到，却一下就刻入了脑海", "空灵的声音，让人难忘",
            "很喜欢你这种声音，简直舒服极了", "如果我能唱的这么棒就好了，支持你", "哇唔~不错啊，超级好听~", "听你的声 音有种特别的感觉，很棒哦", "期待多发点作品，挺好听的", "要不要这么专业，简直棒极了",
            "你的歌我能听很多遍，很耐听，支持支持", "你学过专业的吗?唱的很稳", "为什么这么好听,希望你也能来听我唱的。 ", "朋友~喜欢你的声音~打扰了~", "我静静的坐下，静静的听完整首了。",
            "这首歌已经存在我脑海里挥之不去了", "共鸣度很高嘛~好听好听~支持你，帮我听听我的吧。", "厉害了，你应该可以 唱很高的音吧。", "我悄悄的来~带走了你一曲美妙歌声~",
    };
    public final static String Tab_AutoNewSong[] = {
            "期待你以后的作品", "转发歌曲：支持朋友新歌，支持永远", "终于发新歌了，等了很久了", "我来了，支持新歌。嘎嘎", "看到朋友转发就过来了。还是新鲜的",
            "新歌，好歌，趁热听", "完美新作。支持到底", "又来新作，厉害，加油加油", "好喜欢，这个声音，新歌特棒", "转发歌曲：今天听过的最好的新作", "很厉害。新作无敌。赞赞赞赞在哪在哪在哪",
            "发现一首好歌，还是今天的。", "新歌无限好，听到不想走", "支持新歌，必须循环播放/哈哈", "新歌棒棒哒。好听", "独特风格，支持新歌", "新歌出炉，必须支持，赞赞赞", "原谅我现在才来，不过歌还是新鲜",
            "好歌，趁热听", "完美新作。支持到底", "又来新作，厉害，加油加油", "好喜欢，这个声音，特棒", "转发歌曲： 今天听过的最好的新作", "很厉害。新作无敌。赞赞赞赞在哪在哪在哪",
            "原谅我现在才来，不过歌还是新鲜", "发现一首好歌，还是今天的。","终于发了，等了很久了",
    };

    public final static String Tab_AutoIntro[] = {
            "支持所有的手机K歌软件,电脑K歌软件,独唱、合唱、酷 唱 8 8 1、演讲、喊麦、直播、教学等场景均合用，多功能、多用途",
            "演唱时能听到自己的声音,专业级的K K 8 8 1 混响效果配合，如同亲临KTV包厢酷～唱,录歌时更有感觉、更自信、更轻松",
            "6路硬件声音延迟加法器，声音采样频率高达96KHz，蓝光DVD级别的酷-唱数模及模数K K 8 8 1转换，保证高保真收录",
            "双立体声监听输出功能,辅助练歌，演唱、酷@唱时及时发现问题及时纠正，避免后知后觉，事倍功半，881KK",
            "应用更轻松，更广泛（对唱、聆听、车载、外接功放、有源音箱等）集专业与易用于一身",
            "专业级卡拉OK混音效果，6通道延时、混响可调，可组合出千变万化的音效效果，酷玩、酷唱，炫酷8 8 1-8级电子音量可调",
            "国內首创，采用大规模的FPGA处理器、128KB大容量内存作声音延迟，八 八 一确保延时时间有足够的量程，效果卓越",
            "使用中国好声音，我是歌手等节目中歌手所使用的动圈式8 8 1，摒除噪音，让你酷酷 唱，原汁原味保留真实声音",
            "4000mA大容量锂离子聚合物电池，充电宝/移动电源功能，给手机或其它电器充电，户外K歌能量满满，全程酷  唱",
            "声场效果调整功能：10种声场效果调整，剧院、礼堂、大厅、房间、酷唱......等等效果，总有一款适合你",
            "关机记忆功能，所有效果、配置、酷  唱参数均有关机记忆，8 8 1开机自动读取设置，无需再手动设置",
            "全铝合金一次成型壳体，表面拉丝工艺，二次氧化着色，抗压耐摔、经久耐用，钢铁品质，永远酷 唱不断",
            "PC端调音台软件，USB连接即可调节音效，8 8 1支持音效导出、导入，可以和好友分享自己调制的炫酷  唱音效",
            "使用的是动圈话筒，收录的噪音很小的，低音也很丰富。",
            "使用的是动圈话筒，很适合男性朋友，还原声音的磁性。",
            "使用的是 酷 唱 KK效果器话筒，HIFI的声音处理器。",
            "使用的是KK881话筒，HIFI的声音处理器。",
            "使用的是传统的动圈话筒，在KTV及演唱会歌手们都在使用的。",
            "使用的是传统的有线动圈话筒，在我是歌手现场和音艺术家们在使用的。",
            "使用的是酷 唱 k9 音箱，内置电池，可以蓝牙听手机的歌，听TF卡U盘及FM的歌。",
            "统一回复朋友的询问，使用的是酷 唱 k9 音箱，内置电池，可以与KK881在任意地方唱K。",
            //885系列
            "全数字处理效果,高清高保真收录你的酷 唱，没有烦人的噪声，只保留你最完美的声音和最美妙的乐韵，效果出色8 8 5",
            "酷  唱动圈式拾音设计,结构牢固，性能稳定，经久耐用。频率特性良好,指向性好且8 8 5动圈制式话筒无需直流工作电压，使用简便",
            "精心预设了小剧场、KTV、演唱会及大剧场等4种效果模式选择,可根据不同的场景选择不同的酷 唱效果，尽享多变的8 8 5风格",
            "特别设计酷 唱 8 8 5话筒静音模式，在录音时遇到不想收录的声音时，或者在监听录好的声音时，可以打开以获得更安静的录音/听音环境 ",
            "简约的8 8 5设计一键实现话筒静音/正常及混响等模式切换，操作简单、方便，不用面对一堆按钮、旋钮眼花缭乱不知所措",
            "经典麦克风款式，便携式设计，可在任何时候、任何环境都能有大型KTV室内的效果,就只需要一个8 8 5，随时酷 唱",
            "支持所有手机K歌软件 8 8 5超强兼容，只需一根连接线即可随时随地酷 唱，尽享KTV包房现场K歌的乐趣",
            "8 8 5立体声监听输出功能：演唱时能听到自己的声音，应用更轻松，更广泛（对唱、酷唱、聆听、车载、外接功放、有源音箱等）",
            "带记忆功能：每次开机都会记忆上一次8 8 5的调整状态,无需再重复设置，开机即可轻松享受K歌酷 唱的乐趣，方便快捷",
            "多彩8 8 5 LED灯提示，效果切换、静音、解静音、调整音量......等所有的操作均有不同颜色的LED灯光提示，调整功能一目了然",
            "内置大容量锂电池 8 8 5，充电一次就可以连续酷  唱几个小时，使用时无需连接电源、无需配备充电宝也能酷 唱不断",
//K9系列
            "内置2寸全频扬声器单元2个，给好声音提供强有力的保障，高中低音均表现细腻到位、干脆利落，不拖泥带水，K歌酷 唱好伴侣",
            "高贵典雅香槟金色揉合时尚流畅的流线型K 9外观设计，圆滑厚实的箱体，集实用与美观于一体,酷 唱、K歌必备神器",

            "内置大振膜重低音喇叭单元，使低音动力澎湃、坚实有力，保证K歌酷 唱时声音有足够的低频让声音更加温暖淳厚杜绝声音刺耳感",
            "人性化的圆型按键位于K 9音箱的顶部，具备复合按键功能，播放/暂停、模式切换、接听/挂断来电、拨打电话等等操作均是一个按键即可",
            "蓝牙4.0传输，双向免提通话，10米距离以內自由走动通话清析无杂音、无断续，再也不用被耳机线束缚，尽享 K 9 自由通话乐趣",
            "内置 K 9 全频段FM收音接收器，全自动搜索频道并且自动记忆功能，一次搜索即可永久使用。听收音节目、连接话筒K歌均可，尽享无线 酷 唱 的自由",
            "配备USB、TF卡接口 K 9，直接插U盘或者TF卡即可自动识别并播放里面的音乐文件，无需再外接音源即可随时随地享受美妙的音乐",
            "配备模拟输入接口及连接线，K 9 可连接手机K歌麦、手机、电脑、平板、便携音乐播放器......等外部音源播放，音质出色",
            "1200mA大容量锂离子聚合物电池，提供长达六小时的长时间播放续航能力，户外K歌、听歌的理想之选，外出旅游酷 唱的好伴侣",
            "每声道使用一个独立的数码功放芯片K 9，每个芯片驱动一个喇叭，左右声道的串扰很低，声音更自然更悦耳。2.0立体声环绕 酷  唱 效果",
// 唱吧转灯
            "多彩柔和360度匀速旋转8 0 8灯光，营造专业舞台震撼场景，让你无时无刻都沉浸在舞台中央的现场感，酷 唱更有感觉、更愉悦",
            "配交流整流，直插家用插座即可使用无需任何转换，8 0 8炫丽魔幻图案即时展现眼前，舜时带你深入舞台现场、感受非一般酷 唱效果",
//            "酷唱K吧", "唱吧", "酷我K歌", "爱唱", "好唱", "演唱汇", "爱唱K", "天籁K歌", "K歌达人",
// "应用1", "应用2", "应用3", "应用4", "应用5", "应用6", "应用7", "应用8", "应用9",
    };



    private final static int[] Tab_AutoFace = new int[]{
            0x07d8,0x0084,
            0x07d8,0x008a,
            0x07d8,0x0083,
            0x263a,0x0000,
            0x07d8,0x0089,
            0x07d8,0x008d,
            0x07d8,0x0098,
            0x07d8,0x009a,
//
//            0xe415,0xe056,0xe057,0xe414,0xe057,            0xe105,0xe405,0xe402,0xe417,0xe022,            0xe328,0xe41f,0xe00e,0xe047,0xe30c,
//            0xe03c,0xe03a,0xe042,0xe040,0xe041,            0xe415,0xe056,0xe057,0xe414,0xe057,            0x0000,
    };

    private final static int[] Tab_AppImage = new int[]{
            R.drawable.cnkc, R.drawable.changba, R.drawable.kuwokg, R.drawable.aichang, R.drawable.haochang, R.drawable.aichang,
    };
    public final static String Tab_AppCnName[] = {
            "酷唱K吧", "唱吧", "酷我K歌", "爱唱", "好唱", "演唱汇", "爱唱K", "天籁K歌", "K歌达人",
    };
    public final static String Tab_AppEnName[] = {
//            "APP1", "APP2", "APP3", "APP4", "APP5b", "APP6", "APP7",
            "KalaokBa", "ChangBa", "KuWoKg", "AiChang", "HaoChang", "YanChang", "VvMusic",
    };
    public static String GET_APP_TYPE_NAME(int appType){
        return Tab_AppCnName[appType % Tab_AppCnName.length];
    }
    public static String GET_APP_TYPE_EN_NAME(int appType){
        return Tab_AppEnName[appType % Tab_AppEnName.length];
    }
    public static int GET_APP_TYPE_IMGAGE(int appType) {
        return Tab_AppImage[appType % Tab_AppImage.length];
    }

    public static String GET_CITY_LOCAL(int number) {
        number = Math.abs(number) % Tab_CityLocal.length;
        return Tab_CityLocal[number];
    }
    public static int GET_FACE_STRING(int number){
        number = (Math.abs(number) % (Tab_AutoFace.length / 2)) * 2;
        return ((Tab_AutoFace[number] & 0xffff) << 16) | (Tab_AutoFace[number+1] & 0xffff);
    }
    public static String GET_MOBIL_BRAND(int number){
        if (number < 0){
            Random random = new Random();
            number = random.nextInt();
        }
        number = Math.abs(number) % Tab_APP_MOBIL_BRAND.length;
        return Tab_APP_MOBIL_BRAND[number];
    }
    public static String GET_MAIL_SVR(){
        Random random = new Random();
        int g4Random = Math.abs(random.nextInt()) % Tab_MailSvr.length;
//MDWORD(g4Random);
        return Tab_MailSvr[g4Random];
    }

    public static String GET_RANK_YAN_CHANG(int number){
        number = Math.abs(number) % Tab_YanChang.length;
        return Tab_YanChang[number];
    }
    public static String GET_RANK_CHNAG_BA(int number){
        number = Math.abs(number) % Tab_ChangBaTop.length;
        return Tab_ChangBaTop[number];
    }
    public static String GET_AUTO_COMMENT(){
        Random random = new Random();
        int g4Random = Math.abs(random.nextInt()) % Tab_AutoComment.length;
        return Tab_AutoComment[g4Random];
    }
    public static String GET_AUTO_NEW_SONG(){
        Random random = new Random();
        int g4Random = Math.abs(random.nextInt()) % Tab_AutoNewSong.length;
        return Tab_AutoNewSong[g4Random];
    }
    public static String GET_AUTO_INTRO(){
        Random random = new Random();
        int g4Random = Math.abs(random.nextInt()) % Tab_AutoIntro.length;
        return Tab_AutoIntro[g4Random];
    }
    public static String GET_ALL_AUTO_INTRO(){
        String gsLocal_1 = "";
        int g4Local_1 = 0;
        do {
            gsLocal_1 += Tab_AutoIntro[g4Local_1] + "\r\n";
        } while (++g4Local_1 < Tab_AutoIntro.length);
        return gsLocal_1;
    }
    public static String FIX_STRING_LENGTH(String gsLocal_1, int limit) {
        return gsLocal_1.substring(0, limit > gsLocal_1.length() ? gsLocal_1.length() : limit);
    }
    public static int GET_URL_TO_FILE(String httpUrl, String saveFile){
        int bytesum = 0;
        int byteread = 0;

        URL url = null;
        try {
            url = new URL(httpUrl);
        } catch (MalformedURLException e1) {
            return 0;
        }
        try {
            URLConnection conn = url.openConnection();
            InputStream inStream = conn.getInputStream();
            FileOutputStream fs = new FileOutputStream(saveFile);

            int g4Local_1 = conn.getContentLength();
            byte[] buffer = new byte[1204];
            while ((byteread = inStream.read(buffer)) != -1) {
                bytesum += byteread;
                fs.write(buffer, 0, byteread);
            }
            return bytesum;
        } catch (FileNotFoundException e) {
            e.printStackTrace();
            return 0;
        } catch (IOException e) {
            e.printStackTrace();
            return 0;
        }
    }
    public static int GET_URL_LENGTH(String httpUrl){
        URL url;
        try {
            url = new URL(httpUrl);
        } catch (MalformedURLException e1) {
            return 0;
        }
        try {
            URLConnection conn = url.openConnection();
            return conn.getContentLength();
        } catch (FileNotFoundException e) {
            e.printStackTrace();
            return 0;
        } catch (IOException e) {
            e.printStackTrace();
            return 0;
        }
    }
    public static String GET_MD5_STRING(String message) {
        byte[] bytes = message.getBytes();
        try {
            MessageDigest messageDigest = MessageDigest.getInstance("MD5");
            messageDigest.update(bytes);
            byte[] result = messageDigest.digest();
            StringBuilder sb = new StringBuilder();
            int i = result.length;
            for (int j = 0; j < i; j++) {
                String str1 = Integer.toHexString(0xFF & result[j]);
                if (str1.length() == 1) {
                    sb.append(0);
                }
                sb.append(str1);
            }
            return sb.toString();
        } catch (NoSuchAlgorithmException e) {
            e.printStackTrace();
        }
        return "";
    }
    public static String GET_FILE_MD5(String fileName) {
        try
        {
            File localFile = new File(fileName);
            MessageDigest messageDigest = MessageDigest.getInstance("MD5");
            FileInputStream inputStream = new FileInputStream(localFile);
            byte[] buffer = new byte[8192];
            for (int i = inputStream.read(buffer); i != -1; i = inputStream.read(buffer))
                messageDigest.update(buffer, 0, i);
            inputStream.close();
            byte[] bytes = messageDigest.digest();
            StringBuilder sb = new StringBuilder();
            int j = bytes.length;
            for (int k = 0; k < j; k++){
                String temp = Integer.toHexString(0xFF & bytes[k]);
                if (temp.length() == 1) {
                    sb.append(0);
                }
                sb.append(temp);
            }
            return sb.toString();
        }
        catch (NoSuchAlgorithmException e)
        {
            e.printStackTrace();
        }
        catch (IOException e1)
        {
            e1.printStackTrace();
        }

        return "";
    }
    // 遇到{}用JSONObject，遇到[]用JSONArray
    public static String GET_JSON_STRING(String inString, String key) {
        if (inString != null && inString.length() > 5) {
            try {
                JSONObject object = new JSONObject(inString);
                return object.getString(key);
            } catch (JSONException e) {
            }
        }
        return "";
    }
    public static String GET_JSON_STRING(String inString, String key1, String key2) {
        if (inString != null && inString.length() > 5) {
            JSONTokener tokener = new JSONTokener(inString);
            try {
                JSONObject object = (JSONObject) tokener.nextValue();
                if (!"".equals(key1) && !"".equals(key2)) {
                    return object.getJSONObject(key1).getString(key2);
                }
                return object.getString(key1);
            } catch (JSONException e) {
            }
        }
        return "";
    }
    public static String GET_JSON_ARRAY(String name, String key) {
        try {
            JSONArray jsonArray = new JSONArray(name);
            JSONObject jsonobject = jsonArray.getJSONObject(0);
            // MSTRING(jsonobject.getString("files"));
            return jsonobject.getString(key);
        } catch (JSONException e) {
        }
        return "";
    }
    public static long GET_JSON_VALUE(String inString, String key) {
        if (inString != null && inString.length() > 5) {
            try {
                JSONObject object = new JSONObject(inString);
                return object.getLong(key);
            } catch (JSONException e) {
            }
        }
        return 0;
    }

    public static char changSomeAlphabet(char g2Local_1) {
        if (g2Local_1 == 'o'){
            return '2';
        }
        if (g2Local_1 == 'l'){
            return '3';
        }
        if (g2Local_1 == 'm'){
            return '6';
        }
        if (g2Local_1 == 'n'){
            return '7';
        }
        if (g2Local_1 == 'z'){
            return '8';
        }
        return g2Local_1;
    }
    public static String GET_RANDOM_MAIL(){
        Random random = new Random();
        int g4Random;
        char[] gpLocal_1 = new char[10];
        int g4Local_2 = 0;
        do {
            g4Random = Math.abs(random.nextInt());
            gpLocal_1[g4Local_2] = (char)(Math.abs(g4Random % 26) + 'a');
            if (g4Local_2 > 0){
                gpLocal_1[g4Local_2] = changSomeAlphabet(gpLocal_1[g4Local_2]);
            }
        } while (++g4Local_2 < 10);
        String gsLocal_1 = new String(gpLocal_1);
        g4Random = Math.abs(random.nextInt());
        gsLocal_1 = gsLocal_1.substring(0, (g4Random%5)+5);
        String gsLocal_2 = MUTIL.GET_MAIL_SVR();
        return gsLocal_1 + "@" + gsLocal_2;
    }
    public static String GET_RANDOM_PASSWORD() {
        Random random = new Random();
        int g4Random;
        char[] gpLocal_1 = new char[11];
        int g4Local_2 = 0;
        do {
            g4Random = Math.abs(random.nextInt());
            gpLocal_1[g4Local_2] = (char)(Math.abs(g4Random % 26) + 'a');
            if (g4Local_2 > 0){
                gpLocal_1[g4Local_2] = changSomeAlphabet(gpLocal_1[g4Local_2]);
            }
        } while (++g4Local_2 < 11);
        String gsLocal_1 = new String(gpLocal_1);
        g4Random = Math.abs(random.nextInt());
        return gsLocal_1.substring(0, (g4Random%4)+8);
    }
    public static String GET_RANDOM_NUMBER(int amount) {
        Random random = new Random();
        int g4Random;
        char[] gpLocal_1 = new char[32];
        if (amount > 32){
            amount = 32;
        }
        int g4Local_2 = 0;
        do {
            g4Random = Math.abs(random.nextInt());
            gpLocal_1[g4Local_2] = (char)(Math.abs(g4Random % 10) + '0');
        } while (++g4Local_2 < amount);
        return new String(gpLocal_1,0,amount);
    }

    public static int GET_PERCENT_COUNT(int current, int total){
        if(total > 100){
            total = total / 100;
        }
        else{
            current *= 100;
            if (total == 0){
                total = 1;
            }
        }
        current = current / total;
        if (current > 100){
            current = 100;
        }
        return current;
    }
    public static String MAKE_PROGRAM_STYLE(String gsLocal_1){
        int g4Local_1 = gsLocal_1.length();
        int g4Local_2 = 0;
        char g2Local_1;
        String gsLocal_2 = "";
        do {
            g2Local_1 = gsLocal_1.charAt(g4Local_2);
            if (g2Local_1 == '"' || g2Local_1 == '/'){
                gsLocal_2 += "\\" + g2Local_1;
            }
            else {
                gsLocal_2 += g2Local_1;
            }
        } while (++g4Local_2 < g4Local_1);
        return gsLocal_2;
    }
    public static String HAOCHANG_DATE_TIME(String gsLocal_1) {
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(new Date(MAPI.STRING_DEC32(gsLocal_1) * 1000));
        gsLocal_1 = String.format("%02d-%02d %02d:%02d:%02d", calendar.get(Calendar.MONTH) + 1,
                calendar.get(Calendar.DAY_OF_MONTH), calendar.get(Calendar.HOUR_OF_DAY), calendar.get(Calendar.MINUTE), calendar.get(Calendar.SECOND));
        return gsLocal_1;
    }
    public static String USERID_MASK(int type, String gsLocal_1) {
        int g4Local_1 = 0;
        char gLocal_1 = '0';
        char gLocal_2 = 'q';
        if (type == 1){
            gLocal_1 = 'q';
            gLocal_2 = '0';
        }
        do {
            gsLocal_1 = gsLocal_1.replace(gLocal_1, gLocal_2);
            ++gLocal_1;
            ++gLocal_2;
        } while (++g4Local_1 < 10);
        return gsLocal_1;
    }
    public static String CHANG_DATE_FORMAT(String gsLocal_1){
        SimpleDateFormat format =  new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        Date date = null;
        try {
            date = format.parse(gsLocal_1);
            return String.format("%d", date.getTime()/1000);
        } catch (ParseException e) {
            e.printStackTrace();
        }
        return "";
    }
    public static String SHOW_DATE_FORMAT(int mode, String gsLocal_1) {
        return SHOW_DATE_FORMAT(mode, MAPI.STRING_DEC32(gsLocal_1));
    }
    public static String SHOW_DATE_FORMAT(int mode, long g4Local_1) {
        Date testDate = new Date(g4Local_1 * 1000);
        String gsLocal_1 = "yyyy-MM-dd HH:mm:ss";
        switch (mode) {
            case 1: gsLocal_1 = "MM-dd HH:mm"; break;
            case 2: gsLocal_1 = "yyMMdd HH:mm"; break;
            case 3: gsLocal_1 = "HH:mm:ss"; break;
        }
        SimpleDateFormat format = new SimpleDateFormat(gsLocal_1);
        return format.format(testDate);
    }

    public static byte[] USERID_TOKEN_BUFF8(String ownUserID, String token, String srcUserID) {
        byte gpLocal_1[];
        if (!"".equals(srcUserID)){
            gpLocal_1 = new byte[16];
            MAPI.DWORD_BUFF8(MAPI.STRING_DEC32(srcUserID), 12, gpLocal_1);
        }
        else {
            gpLocal_1 = new byte[12];
        }
        MAPI.DWORD_BUFF8(MAPI.STRING_DEC32(ownUserID), 0, gpLocal_1);
        if (token.startsWith("T")){
            token += "0";
            SubUtils sysUtils = new SubUtils();
            sysUtils.fromAsciiStringToHex(token.substring(1, token.length()), 8, 4, gpLocal_1);
        }
        return gpLocal_1;
    }
    public static byte[] AUTHORIZE_TOKEN_BUFF8(String mixAccount, String userID) {     // "11641250,1477885995,a962b73b958d9b0fd4474de357019af2"
        byte gpLocal_1[];
        if (!"".equals(userID)){
            gpLocal_1 = new byte[28];
            MAPI.DWORD_BUFF8(MAPI.STRING_DEC32(userID), 24, gpLocal_1);
        }
        else {
            gpLocal_1 = new byte[24];
        }
        String[] params = mixAccount.split(",");
        if (params.length > 2){
            MAPI.DWORD_BUFF8(MAPI.STRING_DEC32(params[0]), 0, gpLocal_1);
            MAPI.DWORD_BUFF8(MAPI.STRING_DEC32(params[1]), 4, gpLocal_1);
            SubUtils sysUtils = new SubUtils();
            sysUtils.fromAsciiStringToHex(params[2], 16, 8, gpLocal_1);
        }
        return gpLocal_1;
    }


    public static String GET_RANDOM_ID_STRING(){
        try {
            MessageDigest messageDigest = MessageDigest.getInstance("MD5");
            messageDigest.update((byte)(System.currentTimeMillis()));
            return M16BYTE_ID_STRING(messageDigest.digest());
        } catch (NoSuchAlgorithmException e) {
            e.printStackTrace();
        }
        return "1a85977e-cb50-4e98-a502-3fa82148ffaf";
    }
    public static byte[] MSTRING_16BYTE_ID(String gsLocal_1){
        byte[] gpLocal_1 = new byte[16];
        if (gsLocal_1.length() == 36){
            int g4Local_1 = 0;
            int g4Local_2 = 0;
            int g4Local_3;
            do {
                if (g4Local_1 == 8 || g4Local_1 == 13 || g4Local_1 == 18 || g4Local_1 == 23){
                    g4Local_1 += 1;
                }
                else {
                    g4Local_3 = MAPI.ASCII_HEX(gsLocal_1.charAt(g4Local_1)) << 4;
                    gpLocal_1[g4Local_2++] = (byte)(g4Local_3 | MAPI.ASCII_HEX(gsLocal_1.charAt(g4Local_1+1)));
                    g4Local_1 += 2;
                }
            } while (g4Local_2 < 16);
        }
        return gpLocal_1;
    }
    public static String M16BYTE_ID_STRING(byte[]in_data){
        byte gLocal_1;
        byte gLocal_2;
        byte gLocal_3;
        char g2Local_Buffer[] = new char[36];

        gLocal_1 = 0;
        gLocal_2 = 0;
        do {
            if (gLocal_2 == 8 || gLocal_2 == 13 || gLocal_2 == 18 || gLocal_2 == 23){
                g2Local_Buffer[gLocal_2++] = '-';
            }
            else {
                gLocal_3 = in_data[gLocal_1++];
                g2Local_Buffer[gLocal_2++] = (char) MAPI.HEX_ASCII(gLocal_3 >> 4);
                g2Local_Buffer[gLocal_2++] = (char) MAPI.HEX_ASCII(gLocal_3);
            }
        } while (gLocal_1 < 16);
        return new String(g2Local_Buffer);
    }

    public static String GET_HAO_CHANG_SIGN(String time, String message){
        if (message.charAt(0) == '&'){
            message = message.substring(1, message.length());
        }
        String[] params = message.split("&");
        Arrays.sort(params);                        // 字符串数组升序排列
        String str = "";
        for(String s : params){
            str = str + s + "&";
        }
        str = str.substring(0, str.length() -1);
        return cjmkcs.systemWriteNetCommand(0x84000000, time, str, "", 0);
    }
    public static String GET_SERET_USER_INFO(String input){
        return cjmkcs.systemWriteNetCommand(0x81000000, input, "", "", 0);
    }

//    public static int BUFF8_WRITE_FILE(int add, int length, int offset, byte[]in_data, String fileName){
//        if (add == 0){
//            MAPI.DELETE_FILE(fileName);
//        }
//        try {
//            RandomAccessFile gfLocal_1;
//            gfLocal_1 = new RandomAccessFile(fileName, "rw");
//            if (add > 0){
//                gfLocal_1.seek(gfLocal_1.length());
//            }
//            gfLocal_1.write(in_data, offset, length);
//            gfLocal_1.close();
//            return length;
//        } catch (IOException e) {
//        }
//        return 0;
//    }

    public static void MDWORD(int g4Local_1) {
        Log.d("MSYS", String.format("%08X", g4Local_1));
    }}
